<?php 
/**
 * Author: HoanVX
 * @version: $Id: index.php 19 2014-12-14 11:40:04Z voxuanhoan@gmail.com $
 */
/*
 * Template Name: Homepage page
 */
?>
<?php get_header();?>
	<!-- header-section-ends -->
	<!-- content-section-starts -->
	<div class="content">
		<div class="service-section">
			<div class="service-section-bottom-row">
				<div class="container ">
				<?php 
					$args = array(
							'type'                     => '',
							'child_of'                 => 0,
							'parent'                   => '',
							'orderby'                  => 'count',
							'order'                    => 'ASC',
							'hide_empty'               => 0, //1: hide all empty category without posts
							'hierarchical'             => 0, //
							'exclude'                  => '1', //1: Uncategorized
							'include'                  => '10,15,20,39,49,2,28,44,24',
							'number'                   => '',
							'taxonomy'                 => 'category',
							'pad_counts'               => false
					
					);
				    $cats = get_categories($args) ;

				    // Only for 4 category on a row
				    $catCount = 1;
				    $isCloseDiv = true;
				    foreach ($cats as $cat) {

				    	if($cat->parent == 0) {
				    		if($catCount == 1) {
				    			echo '<div class="row">';
				    			$isCloseDiv = false;
				    		}
				    		$term = get_term($cat->term_id, $cat->taxonomy);
				    		$imgSource = s8_get_taxonomy_image_src($term );
// 				    		get_category_link($cat->cat_ID)
				    		echo '<div class="col-md-3 service-section-bottom-grid wow bounceIn "data-wow-delay="0.2s">';
			    			echo 	'<div class="icon">';
			    			echo 	'<img src="'. $imgSource['src'] .'" class="" alt="'.$cat->description, '" height="66" width="66" />';
			    			echo '</div>';
			    			echo '<div class="icon-data">';
			    			echo 	'<h4>'.$cat->name .'</h4>';
			    			
			    			// Filter child categories from parent category
				    		$argsChild = array(
				    				'type'                     => '',
				    				'child_of'                 => $cat->term_id,
				    				'orderby'                  => 'name',
				    				'order'                    => 'ASC',
				    				'hide_empty'               => 0, //1: hide all empty category without posts
				    				'exclude'                  => '1', //1: Uncategorized
				    				'include'                  => '',
				    				'taxonomy'                 => 'category',
				    				'pad_counts'               => true
				    		);
				    		$catsChilds = get_categories($argsChild);
				    		foreach ($catsChilds as $catChild) {
				    			echo '<p><a href="'. get_category_link($catChild->cat_ID) .'">'.$catChild->name .'</a>';
		    					echo	'<span class="label label-warning countPost">'.$catChild->count .'</span>';
				    			echo  '</p>';
				    			
				    		}
				    		echo '</div>';
							echo '<div class="clearfix"></div>';
							echo '</div>';
							if ($catCount % 4 == 0 && $catCount != 1 ) {
								echo '</div>';
								$isCloseDiv = true;
							}

							if ($catCount == 4) {
								$catCount = 1 ;
								continue;
							}

							$catCount++;
				    	}
				    }
				    if (!$isCloseDiv) 
				    	echo '</div>';
				    ?>
				 <!-- <div class="row">
						<div class="col-md-3 service-section-bottom-grid wow bounceIn "data-wow-delay="0.2s">
							<div class="icon">
								<img src="<?php //bloginfo("stylesheet_directory");?>/images/icon1.jpg" class="img-responsive" alt="" />
							</div>
							<div class="icon-data">
								<h4>Thiết bị Điện tử</h4>
								<p><a href="">Điện thoại</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính để bàn</a> <span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính bảng</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy nghe nhạc MP3</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Linh kiện điện thoại, PC - Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Thiết bị điện tử khác</a><span class="label label-warning countPost">123,456</span></p>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="col-md-3 service-section-bottom-grid wow bounceIn "data-wow-delay="0.2s">
							<div class="icon">
								<img src="<?php //bloginfo("stylesheet_directory");?>/images/home-land.jpg" class="img-responsive" alt="" />
							</div>
							<div class="icon-data">
								<h4>Nhà - Đất</h4>
								<p><a href="">Điện thoại</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính để bàn</a> <span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính bảng</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy nghe nhạc MP3</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Linh kiện điện thoại, PC - Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Thiết bị điện tử khác</a><span class="label label-warning countPost">123,456</span></p>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="col-md-3 service-section-bottom-grid wow bounceIn "data-wow-delay="0.2s">
							<div class="icon">
								<img src="<?php //bloginfo("stylesheet_directory");?>/images/icon1.jpg" class="img-responsive" alt="" />
							</div>
							<div class="icon-data">
								<p><a href="">Điện thoại</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính để bàn</a> <span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính bảng</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy nghe nhạc MP3</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Linh kiện điện thoại, PC - Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Thiết bị điện tử khác</a><span class="label label-warning countPost">123,456</span></p>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="col-md-3 service-section-bottom-grid wow bounceIn "data-wow-delay="0.2s">
							<div class="icon">
								<img src="<?php //bloginfo("stylesheet_directory");?>/images/icon1.jpg" class="img-responsive" alt="" />
							</div>
							<div class="icon-data">
								<p><a href="">Điện thoại</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính để bàn</a> <span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy tính bảng</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Máy nghe nhạc MP3</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Linh kiện điện thoại, PC - Laptop</a><span class="label label-warning countPost">123,456</span></p>
								<p><a href="">Thiết bị điện tử khác</a><span class="label label-warning countPost">123,456</span></p>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>

				 -->
					<div class="clearfix"></div>
				</div>
			</div>
			<div class="popular-restaurents" id="Popular-Restaurants">
				<div class="container">
					<div class="col-md-7 top-cuisines">
						<div class="top-cuisine-head">
							<h3><a href="#">Tin rao VIP</a></h3>
						</div>
						<div class="top-cuisine-grids">
							<div class="list-group">
								<div  class="list-group-item wow bounceIn vipItem" data-wow-delay="0.4s">
									<h4 class="list-group-item-heading"><a>List group item heading</a><span class="viewCount">(Đã xem 201)</span></h4>
									<a><img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgVipRec" alt="" /></a>
									<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
									<p class="price">
										<span class="glyphicon glyphicon-calendar"></span>Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-usd"></span>Giá: <strong> 66,666,000</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-floppy-save"></span>
									</p>
								</div>
								<div  class="list-group-item wow bounceIn vipItem" data-wow-delay="0.4s">
									<h4 class="list-group-item-heading"><a>List group item heading</a><span class="viewCount">(Đã xem 201)</span></h4>
									<a><img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgVipRec" alt="" /></a>
									<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
									<p class="price">
										<span class="glyphicon glyphicon-calendar"></span>Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-usd"></span>Giá: <strong> 66,666,000</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-floppy-save"></span>
									</p>
								</div>
								<div  class="list-group-item wow bounceIn vipItem" data-wow-delay="0.4s">
									<h4 class="list-group-item-heading"><a>List group item heading</a><span class="viewCount">(Đã xem 201)</span></h4>
									<a><img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgVipRec" alt="" /></a>
									<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
									<p class="price">
										<span class="glyphicon glyphicon-calendar"></span>Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-usd"></span>Giá: <strong> 66,666,000</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-floppy-save"></span>
									</p>
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>
					<div class="col-md-5 top-restaurents">
						<div class="top-restaurent-head">
							<h3><a href="#">Tin rao vặt mới nhất</a></h3>
						</div>
				
						<div class="top-restaurent-grids normalPost">
							<div class="list-group">
								<div class="list-group-item wow bounceIn postToolTip" data-toggle="tooltip" data-placement="bottom" data-wow-delay="0.4s" title="Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit">
									<img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgNormalRec" alt="" />
									<h4 class="list-group-item-heading " ><a href="">Donec id elit non mi porta gravida at eget metus.</a></h4>
									<p class="price">
										<span class="glyphicon glyphicon-calendar"></span>Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-usd"></span>Giá: <strong> 66,666,000</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-floppy-save"></span>
									</p>
								</div>
								<div class="list-group-item wow bounceIn postToolTip" data-toggle="tooltip" data-placement="bottom" data-wow-delay="0.4s" title="Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit">
									<img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgNormalRec" alt="" />
									<h4 class="list-group-item-heading " ><a href="">Donec id elit non mi porta gravida at eget metus.</a></h4>
									<p class="price">Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;Giá: <strong> 66,666,000</strong></p>
								</div>
								<div class="list-group-item wow bounceIn postToolTip" data-toggle="tooltip" data-placement="bottom" data-wow-delay="0.4s" title="Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit">
									<img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgNormalRec" alt="" />
									<h4 class="list-group-item-heading " ><a href="">Donec id elit non mi porta gravida at eget metus.</a></h4>
									<p class="price">
										<span class="glyphicon glyphicon-calendar"></span>Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-usd"></span>Giá: <strong> 66,666,000</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-floppy-save"></span>
									</p>
								</div>
								<div class="list-group-item wow bounceIn postToolTip" data-toggle="tooltip" data-placement="bottom" data-wow-delay="0.4s" title="Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit">
									<img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgNormalRec" alt="" />
									<h4 class="list-group-item-heading " ><a href="">Donec id elit non mi porta gravida at eget metus.</a></h4>
									<p class="price">
										<span class="glyphicon glyphicon-calendar"></span>Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-usd"></span>Giá: <strong> 66,666,000</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-floppy-save"></span>
									</p>
								</div>
								<div class="list-group-item wow bounceIn postToolTip" data-toggle="tooltip" data-placement="bottom" data-wow-delay="0.4s" title="Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit">
									<img src="<?php bloginfo("stylesheet_directory");?>/images/restaurent-1.jpg" class="img-responsive imgNormalRec" alt="" />
									<h4 class="list-group-item-heading " ><a href="">Donec id elit non mi porta gravida at eget metus.</a></h4>
									<p class="price">
										<span class="glyphicon glyphicon-calendar"></span>Ngày đăng: <strong>15/10/12014</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-usd"></span>Giá: <strong> 66,666,000</strong>&nbsp;&nbsp;
										<span class="glyphicon glyphicon-floppy-save"></span>
									</p>
								</div>
							</div>
						</div>
					</div>
					<div class="clearfix"></div>
				</div>
				<div class="service-section-top-row">
				<div class="container">
					<div class="service-section-top-row-grids wow bounceInLeft" data-wow-delay="0.4s">
					<div class="col-md-3 service-section-top-row-grid1">
						<h3>Enjoy Exclusive Food Order any of these</h3>
					</div>
					<div class="col-md-2 service-section-top-row-grid2">
						<ul>
							<li><i class="arrow"></i></li>
							<li class="lists">Party Orders</li>
						</ul>
						<ul>
							<li><i class="arrow"></i></li>
							<li class="lists">Home Made Food</li>
						</ul>
						<ul>
							<li><i class="arrow"></i></li>
							<li class="lists"> Diet Food </li>
						</ul>
					</div>
					<div class="col-md-5 service-section-top-row-grid3">
						<img src="<?php bloginfo("stylesheet_directory");?>/images/lunch.png" class="img-responsive" alt="" />
					</div>
					<div class="col-md-2 service-section-top-row-grid4 wow swing animated" data-wow-delay= "0.4s">
						<input type="submit" value="Order Now">
					</div>
					<div class="clearfix"></div>
					</div>
				</div>
			</div>
			</div>
		</div>

		<!-- Contact's information -->
		<?php get_footer("contact");?>
		<!-- END Contact's information -->

	</div>
	<!-- content-section-ends -->
	
	<!-- footer-section-starts -->
	<?php get_footer();?>